import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/search',
    name:'search',
    component: () => import('../views/SearchView')
  },
  {
    path: '/details',
    component: () => import(/* webpackChunkName: "about" */ '../views/DetailsView'),
  },
  {
    path: '/readtest',
    component: () => import(/* webpackChunkName: "about" */ '../views/ReadTestView')
  },
  {
    path: '/test',
    component: () => import(/* webpackChunkName: "about" */ '../views/TestView')
  },
  {
    path: '/login',
    component: () => import('../views/Login')
  },
  {
    path: '/classify',
    component: () => import('../views/Classify')
  },
  {
    path: '/',
    component: () => import('../views/HomeView')
  },
  {
    path: '/t',
    component: () => import('../views/circle/TextBook')  },
  {
    path:'/Register',
    component: () => import('../views/Register')  ,
  },
  {
    path: '/Email',
    component: () => import('../views/Email')  ,
  },
  {
    path: '/top',
    component: () => import('../views/circle/Topic')  ,
    children:[
      {
        path: 'circleinvitation',
        component: () => import('../views/circle/CircleInvitation')  ,
      },
      {
        path: 'invitationdetail',
        component: () => import('../views/circle/InvitationDetail')  ,
      },
    ]
  },
  {
    path: '/user_center',
    component: () => import('../views/userCenter/UserCenter')  ,
    children: [
      {
        path: '',
        component: () => import('../views/userCenter/UserIndex')  ,
        children:[
          {
            path: '',
            component: () => import('../views/userCenter/BuyBook')  ,
          },
          {
            path: '/expenseCalendar',
            component: () => import('../views/userCenter/ExpenseCalendar')  ,
          },
        ]
      },
      {
        path: 'skype',
        component: () => import('../views/userCenter/Skype')  ,
      },
      {
        path: 'skypelist',
        component: () => import('../views/userCenter/SkypeList')  ,
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
